package com.wlgc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.wlgc.dao.UserDao;
import com.wlgc.entity.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserServiceImpl {
    @Resource
    UserDao dao;
    LambdaQueryWrapper<User> wrapper;
    public User getUserById(String id)
    {
        User user = dao.selectById(id);

        return user;

    }
    public  User getUserByUsername(String username)
    {
        wrapper=new LambdaQueryWrapper<>();
        wrapper.eq(User::getUsername,username);
        return dao.selectOne(wrapper);
    }

}
